﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class wallet_afterpay : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write(InsertData().ToString());
    }

    protected bool InsertData()
    {
        string userName = "user";
        string userId = string.Empty;
        string gameId=string.Empty;
        int money = -1000;
        string orderId = string.Empty;
        MODEL.WalletDeputy model = new MODEL.WalletDeputy();
        BLL.WalletDeputy bll = new BLL.WalletDeputy();
        DateTime _time = DateTime.Now;
        model.UDAY = _time.Day.ToString();
        model.UDESCRIBE = "在线充值";
        model.UGAMEID = gameId;
        model.UMONEY = money;
        model.UMONTH = _time.Month.ToString();
        model.UTIME = _time;
        model.UUSERID = new BLL.UserLogon().UserLogonListByName(userName).Tables[0].Rows[0]["Uid"].ToString();
        model.UYEAR = _time.Year.ToString();

        bool flag = bll.WalletDeputyAdd(model);
        if (flag)
        {
            MODEL.OrderDeputy odModel = new MODEL.OrderDeputy();
            odModel.OORDERID = orderId;
            odModel.OTIME = _time;
            odModel.ODESCRIPTION = "支付成功";
            flag = new BLL.OrderDeputy().OrderDeputyAdd(odModel);
        }

        return flag;
    }
}
